From 4831137d359e0abc8c16d152a0c13340c2eed79d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sun, 29 Mar 2020 17:34:01 +0100 Subject: Rename driver.GlucometerDriver to driver.GlucometerDevice. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "driver" is the module — the classes need to be called Device. This allows adding further typing around this. --- glucometerutils/driver.py | 2 +- glucometerutils/drivers/accuchek_reports.py | 2 +- glucometerutils/drivers/fsoptium.py | 2 +- glucometerutils/drivers/otultra2.py | 2 +- glucometerutils/drivers/otultraeasy.py | 2 +- glucometerutils/drivers/otverio2015.py | 2 +- glucometerutils/drivers/otverioiq.py | 2 +- glucometerutils/drivers/sdcodefree.py | 2 +- glucometerutils/drivers/td4277.py | 2 +- glucometerutils/support/contourusb.py | 2 +- glucometerutils/support/freestyle.py | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/glucometerutils/driver.py b/glucometerutils/driver.py index d630031..641a5b6 100644 --- a/glucometerutils/driver.py +++ b/glucometerutils/driver.py @@ -10,7 +10,7 @@ from typing import Generator, Optional, Text from glucometerutils import common -class GlucometerDriver(abc.ABC): +class GlucometerDevice(abc.ABC): def __init__(self, device_path: Optional[Text]) -> None: pass diff --git a/glucometerutils/drivers/accuchek_reports.py b/glucometerutils/drivers/accuchek_reports.py index 0f2c983..5c56597 100644 --- a/glucometerutils/drivers/accuchek_reports.py +++ b/glucometerutils/drivers/accuchek_reports.py @@ -46,7 +46,7 @@ _TIME_FORMAT = "%H:%M" _DATETIME_FORMAT = " ".join((_DATE_FORMAT, _TIME_FORMAT)) -class Device(driver.GlucometerDriver): +class Device(driver.GlucometerDevice): def __init__(self, device: Optional[str]) -> None: if not device or not os.path.isdir(device): raise exceptions.CommandLineError( diff --git a/glucometerutils/drivers/fsoptium.py b/glucometerutils/drivers/fsoptium.py index 789cdfd..38e3a8e 100644 --- a/glucometerutils/drivers/fsoptium.py +++ b/glucometerutils/drivers/fsoptium.py @@ -86,7 +86,7 @@ def _parse_clock(datestr: str) -> datetime.datetime: return datetime.datetime(year, month, day, hour, minute, second) -class Device(serial.SerialDevice, driver.GlucometerDriver): +class Device(serial.SerialDevice, driver.GlucometerDevice): BAUDRATE = 19200 DEFAULT_CABLE_ID = "1a61:3420" diff --git a/glucometerutils/drivers/otultra2.py b/glucometerutils/drivers/otultra2.py index 9b74da8..56138b9 100644 --- a/glucometerutils/drivers/otultra2.py +++ b/glucometerutils/drivers/otultra2.py @@ -130,7 +130,7 @@ def _parse_datetime(response: str) -> datetime.datetime: return datetime.datetime(2000 + year, month, day, hour, minute, second) -class Device(serial.SerialDevice, driver.GlucometerDriver): +class Device(serial.SerialDevice, driver.GlucometerDevice): BAUDRATE = 9600 DEFAULT_CABLE_ID = "067b:2303" # Generic PL2303 cable. diff --git a/glucometerutils/drivers/otultraeasy.py b/glucometerutils/drivers/otultraeasy.py index 00f00b6..98de4fb 100644 --- a/glucometerutils/drivers/otultraeasy.py +++ b/glucometerutils/drivers/otultraeasy.py @@ -117,7 +117,7 @@ def _make_packet( ) -class Device(serial.SerialDevice, driver.GlucometerDriver): +class Device(serial.SerialDevice, driver.GlucometerDevice): BAUDRATE = 9600 DEFAULT_CABLE_ID = "067b:2303" # Generic PL2303 cable. TIMEOUT = 0.5 diff --git a/glucometerutils/drivers/otverio2015.py b/glucometerutils/drivers/otverio2015.py index 44d03b1..facd31c 100644 --- a/glucometerutils/drivers/otverio2015.py +++ b/glucometerutils/drivers/otverio2015.py @@ -107,7 +107,7 @@ _READ_RECORD_RESPONSE = construct.Struct( ) -class Device(driver.GlucometerDriver): +class Device(driver.GlucometerDevice): def __init__(self, device: Optional[str]) -> None: if not device: raise exceptions.CommandLineError( diff --git a/glucometerutils/drivers/otverioiq.py b/glucometerutils/drivers/otverioiq.py index f7b87dc..aff6b4a 100644 --- a/glucometerutils/drivers/otverioiq.py +++ b/glucometerutils/drivers/otverioiq.py @@ -94,7 +94,7 @@ _READING_RESPONSE = construct.Struct( ) -class Device(serial.SerialDevice, driver.GlucometerDriver): +class Device(serial.SerialDevice, driver.GlucometerDevice): BAUDRATE = 38400 DEFAULT_CABLE_ID = "10c4:85a7" # Specific ID for embedded cp210x TIMEOUT = 0.5 diff --git a/glucometerutils/drivers/sdcodefree.py b/glucometerutils/drivers/sdcodefree.py index 35ff8c7..2bb0dd8 100644 --- a/glucometerutils/drivers/sdcodefree.py +++ b/glucometerutils/drivers/sdcodefree.py @@ -84,7 +84,7 @@ _READING = construct.Struct( ) -class Device(serial.SerialDevice, driver.GlucometerDriver): +class Device(serial.SerialDevice, driver.GlucometerDevice): BAUDRATE = 38400 DEFAULT_CABLE_ID = "10c4:ea60" # Generic cable. TIMEOUT = 300 # We need to wait for data from the device. diff --git a/glucometerutils/drivers/td4277.py b/glucometerutils/drivers/td4277.py index 7ee177d..717e4ab 100644 --- a/glucometerutils/drivers/td4277.py +++ b/glucometerutils/drivers/td4277.py @@ -132,7 +132,7 @@ def _select_record(record_id: int) -> bytes: return _READING_SELECTION_STRUCT.build({"record_id": record_id}) -class Device(serial.SerialDevice, driver.GlucometerDriver): +class Device(serial.SerialDevice, driver.GlucometerDevice): BAUDRATE = 19200 TIMEOUT = 0.5 diff --git a/glucometerutils/support/contourusb.py b/glucometerutils/support/contourusb.py index e27347e..cf78d69 100644 --- a/glucometerutils/support/contourusb.py +++ b/glucometerutils/support/contourusb.py @@ -71,7 +71,7 @@ class Mode(enum.Enum): COMMAND = enum.auto() -class ContourHidDevice(driver.GlucometerDriver): +class ContourHidDevice(driver.GlucometerDevice): """Base class implementing the ContourUSB HID common protocol. """ diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py index 9cdbff9..40482b0 100644 --- a/glucometerutils/support/freestyle.py +++ b/glucometerutils/support/freestyle.py @@ -286,7 +286,7 @@ class FreeStyleHidSession: return csv.reader(records_str.split("\r\n")) -class FreeStyleHidDevice(driver.GlucometerDriver): +class FreeStyleHidDevice(driver.GlucometerDevice): """Base class implementing the FreeStyle HID common protocol. This class implements opening, initializing the connection and sending -- cgit v1.2.3